package com.zhihu_lvliangi_android.option.zhengwu.adapter;

import java.util.List;

import com.zhihu_lvliangi_android.R;
import com.zhihu_lvliangi_android.domain.ZhengwuGuideItem;
import com.zhihu_lvliangi_android.util.ViewHolder;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class ZhengWuItemListAdapter extends BaseAdapter {
	private Context mContext;
	private List<ZhengwuGuideItem> mItems;
	
	public ZhengWuItemListAdapter(Context context ,List<ZhengwuGuideItem> items){
		this.mContext = context;
		this.mItems = items;
	}
	
	
	public void setmItems(List<ZhengwuGuideItem> mItems) {
		this.mItems = mItems;
	}


	@Override
	public int getCount() {
		return mItems.size();
	}

	@Override
	public ZhengwuGuideItem getItem(int arg0) {
		return mItems.get(arg0);
	}

	@Override
	public long getItemId(int arg0) {
		return arg0;
	}

	@Override
	public View getView(int pos, View conentView, ViewGroup parent) {
		if (conentView == null) {
			conentView = LayoutInflater.from(mContext).inflate(R.layout.general_text_view,null);
			
		}
		TextView textView = ViewHolder.get(conentView,R.id.general_txt);
		textView.setText(mItems.get(pos).getGuide_name());
		
		return conentView;
	}

}
